<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script src="js/jquery.min.js"></script>
	</head>
	<body>
		<form>
			<input id="随和" type="checkbox" value="随和" checked="checked"/>
			<label for="随和">随和</label>
			<input id="你好" type="checkbox" value="你好" />
			<label for="你好">你好</label>
			<input id="我是" type="checkbox" value="我是" />
			<label for="我是">我是</label>
			<input id="哈哈" type="checkbox" value="哈哈" />
			<label for="哈哈">哈哈</label>
			<input id="内容" type="checkbox" value="内容" />
			<label for="内容">内容</label>
			<input id="value" type="checkbox" value="value" />
			<label for="value">value</label>
			<input id="好烦" type="checkbox" value="好烦" />
			<label for="好烦">好烦</label>
		</form>
		<input type="text" class="text" />
		<script type="text/javascript">
			$('input').click(function(){
				var arr=[];
				var value='';
				$('input:checked').each(function(){
                		arr.push($(this).val())
						//console.log(arr)
				})
				for(key in arr){
				 value += arr[key]+','
				}
				
				value=(value.substring(value.length-1)==',')?value.substring(0,value.length-1):value;
				console.log(value)
				$('.text').val(value)
			})
			
		</script>
	</body>
</html>
